﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using EzDesk.Generic;

namespace EzDesk.DesktopClient
{
    public class ClientDbStorage
    {
        private readonly string _relatedPath = "user\\data";
        private readonly string _storeType = "database";
        public readonly string DatabaseUrl = "EzDesktopClientDb.db";

        protected string GetFilePath(string name, string storeType)
        {
            string folderName = Path.Combine(PathHelp.CurrentPath, _relatedPath, storeType);
            if (!Directory.Exists(folderName))
                Directory.CreateDirectory(folderName);
            return Path.Combine(folderName, name);
        }

        public string GetConnectionString(string name)
        {
            return string.Format("Data Source={0}", Path.Combine(PathHelp.CurrentPath,"Data",DatabaseUrl));
        }
    }
}
